package com.xie.dome.searchservice.controller;

import com.xie.dome.searchservice.model.ResultSet;
import com.xie.dome.searchservice.service.DataBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author xie
 */
@RestController
@RequestMapping("/database")
public class DataBaseController {

    @Autowired
    private DataBaseService dataBaseService;

    /**
     * 查询数据库配置
     *
     * @return
     */
    @GetMapping("/getConfigValueList")
    public ResultSet findConfigValueList() {
        ResultSet resultSet = new ResultSet();
        List<Map<String, Object>> list = dataBaseService.findConfigValueList();
        resultSet.setCode(100);
        resultSet.setResult(list);
        return resultSet;
    }

}
